package com.xbongbong.paas.pojo.workflow.task.dto;

import com.xbongbong.paas.domain.entity.ext.PaasAttachmentEntityExt;
import com.xbongbong.paas.toolbox.wrap.BaseDTO;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.ArrayList;
import java.util.List;

/**
 * @author chenpeng
 * @version 1.0
 * @date 2021-05-11 15:43
 * @description
 */
@Setter
@Getter
@ToString
public class WorkflowCommentAddDTO extends BaseDTO {

    private static final long serialVersionUID = 7274570437309034999L;

    @NotNull(message = "{dto.msg.appId.NotNull}")
    private Long appId;
    /**
     * 引用id
     */
    @NotNull(message = "{dto.msg.workflowCommentAdd.refId.NotNull}")
    private Long refId;
    
    /**
     * 评论内容
     */
    @NotBlank(message = "{dto.msg.workflowCommentAdd.content.NotBlank}")
    @Size(max = 2000,message = "{dto.msg.workflowCommentAdd.content.Size}")
    private String content;
    
    /**
     * 艾特的用户id
     */
    private List<String> atUserIds;
    
    /**
     * 用户名称
     */
    private String userName;
    
    /**
     * 用户头像
     */
    private String userAvatar;
    
    /**
     * 被回复人user_id
     */
    private String refUserId;
    
    /**
     * 被回复人用户名称
     */
    private String refUserName;
    
    /**
     * 图片列表
     */
    private List<String> images;
    
    /**
     * 文件列表
     */
    @Valid
    private List<PaasAttachmentEntityExt> attachmentList;
    
    private Long dataId;
    
    private Long formId;

    /**
     * 是否勾选需要提醒（勾了：true，没勾：false）
     */
    private Boolean isInform;

//    /**
//     * 业务类型
//     */
//    @NotNull(message = "{dto.msg.commentAdd.businessType.NotNull}")
//    private Integer businessType;
    
    public WorkflowCommentAddDTO(){
        content = "";
        userName = "";
        userAvatar = "";
        refUserId = "";
        refUserName = "";
        images = new ArrayList<>();
        attachmentList = new ArrayList<>();
    }
    
    public void setAtUserIds(List<String> atUserIds) {
        this.atUserIds = atUserIds == null ? new ArrayList<>() : atUserIds;
    }
    
}
